<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!-- pageEncoding="UTF-8"%> -->



<%-- <%@ taglib prefix="s" uri="/struts-tags"%> --%>
<%-- <%@ page contentType="text/html;charset=UTF-8"language="java"%> --%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%-- <%@ page import="edu.uit.se.laps.web.*,java.util.*,java.text.*" %> --%>
<%@ page
	import="edu.uit.se.laps.web.*,edu.uit.se.laps.web.controller.*, java.net.*,java.text.*,java.util.*"%>



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>



<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<style>
body,input {
	font-family: Calibri, Arial;
}

table#contact {
	border-collapse: collapse;
	width: 550px;
}

th {
	height: 40px;
	background-color: #ffee55;
}
</style>
<title>Quản Lý Sản Phẩm - Struts2 Hibernate Web</title>


</head>
<body>

	<%
		ShoppingCart cart = (ShoppingCart) session
				.getAttribute("ShoppingCart");

		if (cart == null) {
			cart = new ShoppingCart();
			session.setAttribute("ShoppingCart", cart);
		}

		//Vector items = cart.getItems();

		//if (items.size() != 0) {

		//}
	%>


	<h1>Cac sản phẩm</h1>

	<a href="showCart">Hien thi gio hang</a>
	<a href="dangnhap.jsp">Dang nhap</a>



	<h2>Thông tin sản phẩm</h2>
	<table id="sp" border="1">
		<tr>
			<th>Id Sản phẩm</th>
			<th>Tên sản phẩm</th>
			<th>Loại sản phẩm</th>
			<th>Chủng loại</th>
			<th>Thương hiệu</th>
			<th>Mô tả ngắn</th>
			<th>Mô tả</th>
			<th>Ngày cập nhật</th>
			<th>Giá</th>
			<th>Số lượng tồn kho</th>
			<th>Số lượng mua</th>
			<th>Add to carrt</th>
			<th>Chỉnh sửa</th>
			<th>Delete</th>
		</tr>
		<s:iterator value="spList" var="sp">
			<tr>

				<%-- 				<s:form name="addtoshoppingcart" action="addtoshoppingcart"	method="POST"> --%>
				<s:form action="addtoshoppingcart" method="post">

					<td><div>
							heee:
							<s:property value="idSP" />
							<s:set var="id" value="%{#attr['idSP']}" />
						</div></td>
					<td><s:property value="tenSP" /></td>
					<td><s:property value="idLoaiSP" /></td>
					<td><s:property value="idCL" /></td>
					<td><s:property value="thuongHieu" /></td>
					<td><s:property value="moTaNgan" /></td>
					<td><s:property value="moTa" /></td>
					<td><s:property value="ngayCapNhat" /></td>
					<td><s:property value="ngayCapNhat" /></td>
					<td><s:textfield name="id" /></td>
					<td><s:textfield name="soLuong" /></td>

					<td>
						<%-- <a href="addtoshoppingcart?idsp=<s:property value="idSP"/>">AddToCart</a> --%>
						<s:hidden name="idsp" value="%{#attr['idSP']}" /> <s:submit
							value="Thêm vao gio hang" align="center" />
					</td>

					<td><a
						href="addtoshoppingcart?idsp=<s:property value="idSP"/>">Sua</a></td>
					<td><a href="deleteSP?idsp=<s:property value="idSP"/>">delete</a></td>

				</s:form>

			</tr>
		</s:iterator>
	</table>
	<%-- 	<jsp:include page="displayshoppingcart.jsp" flush="true" /> --%>

	<!-- 	<h1>Gio hang</h1> -->
	<!-- 	<h2>Thông tin sản phẩm</h2> -->
	<!-- 	<table id="ctsp" border="1"> -->
	<!-- 		<tr> -->
	<!-- 			<th>Id san pham</th> -->
	<!-- 			<th>Id Sản Phẩm</th> -->
	<!-- 			<th>Id Đơn Hàng</th> -->
	<!-- 			<th>Đơn giá</th> -->
	<!-- 			<th>Số Lượng</th> -->
	<!-- 			<th>So lan mua</th> -->

	<!-- 			<th>Chỉnh sửa</th> -->
	<!-- 			<th>Delete</th> -->
	<!-- 		</tr> -->
	<%-- 		<s:iterator value="carts" var="sp"> --%>
	<!-- 			<tr> -->

	<!-- 				<td><div> -->
	<!-- 						heee: -->
	<%-- 						<s:property value="idSP" /> --%>
	<!-- 					</div></td> -->
	<%-- 				<td><s:property value="tenSP" /></td> --%>
	<%-- 				<td><s:property value="tenSP" /></td> --%>
	<%-- 				<td><s:property value="tenSP" /></td> --%>
	<%-- 				<td><s:property value="tenSP" /></td> --%>
	<%-- 				<td><s:property value="soLanMua" /></td> --%>



	<%-- 				<td><a href="showupdate?idsp=<s:property value="idSP"/>&soLuong=<s:property value="soLanMua"/>" method="post">Update</a></td> --%>
	<%-- 				<td><a href="deleteSP?idsp=<s:property value="idSP"/>">delete</a></td> --%>

	<!-- 			</tr> -->
	<%-- 		</s:iterator> --%>
	<!-- 	</table> -->








</body>
</html>